#include <iostream>
#define LL long long
using namespace std;

const int kMaxN = 5010;

LL f[2][kMaxN], sum[kMaxN];

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    cin >> sum[i];
    sum[i] += sum[i - 1];
  }
  for (int i = 0; i < k; i++) {
    fill(f[(i + 1) & 1], f[(i + 1) & 1] + n + 1, 0);
    for (int j = m * (i + 1); j <= n; j++) {
      f[(i + 1) & 1][j] = max(f[(i + 1) & 1][j], f[i & 1][j - m] + sum[j] - sum[j - m]);
      f[(i + 1) & 1][j] = max(f[(i + 1) & 1][j], f[(i + 1) & 1][j - 1]);
    }
  }
  cout << f[k & 1][n] << "\n";
  return 0;
}